<template>
  <div class="header-wrap">
    <div class="d-flex jc-center title_wrap">
      <div class="zuojuxing"></div>
      <div class="youjuxing"></div>
      <div class="guang"></div>
      <div class="d-flex jc-center">
        <div class="title">
          <span class="title-text">城市体检</span>
        </div>
      </div>
      <div class="timers">{{ dateData.dateDay }} {{ dateData.dateWeek }}</div>
    </div>
  </div>
</template>

<script setup lang="ts">
import { reactive } from "vue";
import dayjs from "dayjs";
import type { DateDataType } from "./index.d";

const dateData = reactive<DateDataType>({
  dateDay: "",
  dateWeek: "",
  timing: null,
});

const weekday = ["周日", "周一", "周二", "周三", "周四", "周五", "周六"];
const timeFn = () => {
  dateData.timing = setInterval(() => {
    dateData.dateDay = dayjs().format("YYYY-MM-DD HH : mm : ss");
    dateData.dateWeek = weekday[dayjs().day()];
  }, 1000);
};
timeFn();
</script>


<style scoped lang="scss">
.header-wrap {
  height: 68px;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.8), rgba(0, 0, 0, 0.1));
  z-index: 9;
  position: relative;
}

.title_wrap {
  height: 60px;
  // background: linear-gradient(180deg, rgba(0, 0, 0, 1), rgba(0, 0, 0, 0.8));
  background-image: url("@/assets/img/top.png");
  background-size: contain;
  background-position: center center;
  position: relative;
  margin-bottom: 4px;

  z-index: 9;

  .guang {
    position: absolute;
    bottom: -26px;
    background-image: url("@/assets/img/guang.png");
    background-position: 80px center;
    width: 100%;
    height: 56px;
  }

  .zuojuxing,
  .youjuxing {
    position: absolute;
    top: -2px;
    width: 140px;
    height: 6px;
    background-image: url("@/assets/img/headers/juxing1.png");
  }

  .zuojuxing {
    left: 11%;
  }

  .youjuxing {
    right: 11%;
    transform: rotate(180deg);
  }

  .timers {
    position: absolute;
    right: 24px;
    top: 20px;
    font-size: 18px;
    display: flex;
    align-items: center;

    .setting_icon {
      width: 20px;
      height: 20px;
      cursor: pointer;
      margin-left: 12px;

      img {
        width: 100%;
        height: 100%;
      }
    }
  }
}

.title {
  position: relative;
  // width: 500px;
  text-align: center;
  background-size: cover;
  color: transparent;
  height: 60px;
  line-height: 46px;

  .title-text {
    font-size: 38px;
    font-weight: 900;
    letter-spacing: 6px;
    width: 100%;
    background: linear-gradient(
      92deg,
      #0072ff 0%,
      #00eaff 48.8525390625%,
      #01aaff 100%
    );
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
  }
}
</style>
